package com.code.user.model.bo;

import com.code.commons.annotations.EnumValue;
import com.code.user.model.po.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

/**
 * 登录的用户的业务对象
 *
 * @author tangyifei
 * @since 2019-5-24 09:37:16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class LoginUser implements Serializable {

    private static final long serialVersionUID = -3675314128118074922L;

    @ApiModelProperty(value = "用户ID", example = "1")
    private String id;

    @ApiModelProperty(value = "昵称", example = "1")
    private String nickname;

    @ApiModelProperty(value = "手机号", example = "+86150****0055")
    private String phone;

    @ApiModelProperty(value = "区号", example = "+86")
    private String areaNo;

    @ApiModelProperty(value = "性别", example = "1")
    private String gender;

    @ApiModelProperty(value = "头像", example = "1")
    private String avatar;

    @ApiModelProperty(value = "用户等级", example = "V1")
    private String userLevel;

    @ApiModelProperty(value = "类型", example = "1")
    private String type;

    @ApiModelProperty(value = "账号状态", example = "1")
    @EnumValue(enumClass = User.UserStatusEnum.class, enumMethod = "isValidName")
    private String status;

    @ApiModelProperty(value = "是否为超级管理员 0不是超级管理员  1超级管理员", example = "1")
    private Integer isAdmin;

    @ApiModelProperty(value = "最新登陆IP", example = "1")
    private String latestLoginIp;

    @ApiModelProperty(value = "最新登陆时间", example = "1")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date latestLoginTime;

    @ApiModelProperty(value = "用户币种余额相关的版本号", example = "0")
    private Integer userCoinBalanceVersion;

    @ApiModelProperty(value = "基础证件认证状态 0未认证 1认证中 2认证成功 3认证失败 非必填", example = "0")
    private Integer baseAuthState;

    @ApiModelProperty(value = "高级证件认证状态 0未认证 1认证中 2认证成功 3认证失败 非必填", example = "0")
    private Integer highAuthState;

    @ApiModelProperty(value = "1身份证 2护照 必填", example = "1")
    private Integer certificationType;

    @ApiModelProperty(value = "用户名称", example = "1")
    private String name;

}
